package com.example.social.screen.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.example.social.R

@Composable
fun NotThreadList(contextText:String) {
    Box(
        modifier = Modifier
            .fillMaxSize(), // 占满整个屏幕
        contentAlignment = Alignment.Center // 内容居中对齐
    ) {
        Column(
            horizontalAlignment = Alignment.CenterHorizontally, // 列内的元素水平居中
            verticalArrangement = Arrangement.Center // 列内的元素垂直居中
        ) {
            // 显示图片
            Image(
                painter = painterResource(id = R.drawable.no_content), // 替换成你的图片资源
                contentDescription = "暂无用户发布话题",
                modifier = Modifier.size(300.dp) // 设置图片大小
            )

            Spacer(modifier = Modifier.height(16.dp)) // 图片和文字之间的间距

            // 显示文字
            Text(
                text = contextText,
                style = MaterialTheme.typography.titleLarge, // 设置文字样式
                textAlign = TextAlign.Center, // 文字居中
                modifier = Modifier.padding(16.dp)
            )
        }
    }
}